package me.xiaoyan.java.chapter15;

import java.util.Scanner;

public class StringExample1 {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		String strSource = "小白是个好孩子!";
		// 字符串长度
		System.out.println("字符串长度为:" 
				+ strSource.length());
//		System.out.print("用户名 密码:");
//		String userName = input.next();
//		String password = input.next();
//		if(userName.equals("admin") 
//				&& "123456".equals(password)){
//			System.out.println("登录成功");
//		}else{
//			System.out.println("用户名密码不匹配!");
//		}
		String name = new String("小白");
		
		if(name.equals("小白")){
			System.out.println("true");
		}else{
			System.out.println("false");
		}
		
		String address = "100,唐人街,NY City";
		System.out.println(address.toUpperCase());//转成大写
		System.out.println(address.toLowerCase());//装成小写
		//字符串连接
		String personInfo = name.concat(address);
		System.out.println(personInfo);
		System.out.println(name + address);
	}
}
